package com.mokairui.share_model_memory;

import lombok.extern.slf4j.Slf4j;

/**
 * @Description
 * @Author Mokairui
 * @Since 2021/10/4
 */
@Slf4j(topic = "c.testVisible")
public class testDemo {
    static boolean flag = true;
    public static void main(String[] args) {
        new Thread(() -> {
            log.debug(String.valueOf(flag));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            log.debug(String.valueOf(flag));
        }).start();

        new Thread(() -> {
            flag = false;
            log.debug("modify: " + String.valueOf(flag));
        }).start();
    }
}
